package com.lbw   .composite;


import java.util.ArrayList;
import java.util.List;

/**
 * @author lbw
 * @version 1.0
 * @date 2021/6/4 19:19
 */
public class University extends OrganizationComponent {

    private List<OrganizationComponent> organizationComponents = new ArrayList<>();

    public University(String name, String des) {
        super(name, des);
    }

    @Override
    protected void print() {
        System.out.println("-------------------" + getName() + "----------------------");
        for (OrganizationComponent item : organizationComponents) {
            item.print();
        }
    }

    @Override
    protected void add(OrganizationComponent organizationComponent) {
        organizationComponents.add(organizationComponent);
    }

    @Override
    protected void remove(OrganizationComponent organizationComponent) {
        organizationComponents.remove(organizationComponent);
    }

    @Override
    public String getName() {
        return super.getName();
    }

    @Override
    public String getDes() {
        return super.getDes();
    }
}
